package org.example.controller;

import org.example.dao.TimeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class TimeController {
    @Autowired
    private TimeDao timeDao;

    @RequestMapping("/time/hour")
    public List<Map<String,Object>> selectByHour(){
        List<Map<String,Object>> result =
                timeDao.selectByHour();
        return result;
    }

    @RequestMapping("/time/day")
    public List<Map<String,Object>> selectByDay(){
        List<Map<String,Object>> result =
                timeDao.selectByDay();
        return result;
    }

    @RequestMapping("/time/month")
    public List<Map<String,Object>> selectByMonth(){
        List<Map<String,Object>> result =
                timeDao.selectByMonth();
        return result;
    }

}
